/**
 * 
 */
package com.faxsun.core.persist.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @author langhsu
 * 
 * 为评论增加类型字段
 * @author songdragon
 *
 */
@Entity
@Table(name = "fx_comments")
public class CommentPO {
    
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private long id;
	
	@Column(name = "to_id")
	private long toId;
	
	@Column(name = "content")
	private String content;
	
	@Column(name = "created")
	private Date created;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "author_id")
	private UserPO author;
	
	/**
	 * 0,待审核；1,已发布；2，删除（与PostPO相同{@link PostPO#getStatus()}）
	 */
	private int status;
	
	/**
	 * 评论类型，0，对产品评论；1，对文章评论；2，用户站内信；3，直播页面<br/>
	 * 详见{@link com.faxsun.core.pojos.enums.CommentType}
	 * <p> 如果是针对某条评论/站内信的回复加特殊标记_@ReplY@_ 
	 * {@link com.faxsun.core.service.CommentService#REPLY_TOKEN}
	 */
	@Column(name="type", columnDefinition="tinyint not null default 0")
	private Integer type;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public long getToId() {
		return toId;
	}

	public void setToId(long toId) {
		this.toId = toId;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public UserPO getAuthor() {
		return author;
	}

	public void setAuthor(UserPO author) {
		this.author = author;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	
}
